package org.example.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.example.api.CommonResult;
import org.example.model.Record;
import org.example.service.RecordService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Api(tags = "RecordController", description = "消费记录")
@Controller
@RequestMapping(value = "/record")
public class RecordController {
    private static final Logger LOGGER = LoggerFactory.getLogger(CustomerController.class);
    @Autowired
    private RecordService recordService;

    @RequestMapping(value = "/get/{phoneNum}", method = RequestMethod.GET)
    @ResponseBody
    public CommonResult getByPhoneNum(@PathVariable("phoneNum") int phoneNum) {
        return CommonResult.success(recordService.getByPhoneNum(phoneNum));
    }
}
